home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume10 / xlisp21 / part03 < prev    next >
Encoding:
Text File  |  1990-02-26  |  49.3 KB  |  1,891 lines

  1. Newsgroups: comp.sources.misc
  2. organization: Cognos Inc., Ottawa, Canada
  3. subject: v10i090: XLisP 2.1 Sources 1c (3/3) / 5
  4. From: garym@cognos.UUCP (Gary Murphy)
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 10, Issue 90
  8. Submitted-by: garym@cognos.UUCP (Gary Murphy)
  9. Archive-name: xlisp21/part03
  10.  
  11. #!/bin/sh
  12. # This is a shell archive, meaning:
  13. # 1. Remove everything above the #!/bin/sh line.
  14. # 2. Save the resulting text in a file.
  15. # 3. Execute the file with /bin/sh (not csh) to create the files:
  16. #    xlspeed.dif
  17. # This archive created: Sun Feb 18 23:29:48 1990
  18. # By:    Gary Murphy ()
  19. export PATH; PATH=/bin:$PATH
  20. echo shar: extracting "'xlspeed.dif'" '(47351 characters)'
  21. if test -f 'xlspeed.dif'
  22. then
  23.     echo shar: over-writing existing file "'xlspeed.dif'"
  24. fi
  25. sed 's/^X//' << \SHAR_EOF > 'xlspeed.dif'
  26. XFrom sce!mitel!uunet!lll-winken!ames!haven!umd5!jonnyg Tue May 23 15:37:24 EDT 1989
  27. XArticle: 91 of comp.lang.lisp.x
  28. XPath: cognos!sce!mitel!uunet!lll-winken!ames!haven!umd5!jonnyg
  29. XFrom: jonnyg@umd5.umd.edu (Jon Greenblatt)
  30. XNewsgroups: comp.lang.lisp.x
  31. XSubject: Xlisp2.0 speedups... (Part 1 of 3)
  32. XMessage-ID: <4912@umd5.umd.edu>
  33. XDate: 18 May 89 16:58:56 GMT
  34. XReply-To: jonnyg@umd5.umd.edu (Jon Greenblatt)
  35. XOrganization: University of Maryland, College Park
  36. XLines: 910
  37. X
  38. XThe following are changes I have made to xlisp 2.0 source. Most of these
  39. Xchanges produce considerable speed ups. This distribution is very
  40. Xrough but maybe someone can wade through it and come of with a cleaned
  41. Xup version of the speed ups. Note this is a striaght context diff so
  42. Xmore than just the speed ups are included, BEWARE! If you are able to
  43. Xclean up or enhance these speed ups in any way I would apreciate the
  44. Xfeedback.
  45. X
  46. X                JonnyG.
  47. X
  48. Xdiff -c ../xlisp.org/xlbfun.c ../xlisp/xlbfun.c
  49. X*** ../xlisp.org/xlbfun.c    Sun May  7 22:25:38 1989
  50. X--- ../xlisp/xlbfun.c    Wed Apr  5 16:18:23 1989
  51. X***************
  52. X*** 558,563 ****
  53. X--- 558,578 ----
  54. X      return (val);
  55. X  }
  56. X  
  57. X+ LVAL xcopyarray()
  58. X+ {
  59. X+     LVAL src, dest;
  60. X+     int num;
  61. X+     register int i;
  62. X+ 
  63. X+     src = xlgavector();
  64. X+     dest = xlgavector();
  65. X+     xllastarg();
  66. X+     num = (getsize(src) < getsize(dest)) ? getsize(src) : getsize(dest);
  67. X+     for (i = 0; i < num; i++)
  68. X+         setelement(dest,i,getelement(src,i));
  69. X+     return(dest);
  70. X+ }
  71. X+ 
  72. X  /* xerror - special form 'error' */
  73. X  LVAL xerror()
  74. X  {
  75. Xdiff -c ../xlisp.org/xldbug.c ../xlisp/xldbug.c
  76. X*** ../xlisp.org/xldbug.c    Sun May  7 22:25:43 1989
  77. X--- ../xlisp/xldbug.c    Wed Apr  5 16:18:24 1989
  78. X***************
  79. X*** 14,20 ****
  80. X  extern char buf[];
  81. X  
  82. X  /* external routines */
  83. X! extern char *malloc();
  84. X  
  85. X  /* forward declarations */
  86. X  FORWARD LVAL stacktop();
  87. X--- 14,20 ----
  88. X  extern char buf[];
  89. X  
  90. X  /* external routines */
  91. X! extern char *xlmalloc();
  92. X  
  93. X  /* forward declarations */
  94. X  FORWARD LVAL stacktop();
  95. Xdiff -c ../xlisp.org/xldmem.c ../xlisp/xldmem.c
  96. X*** ../xlisp.org/xldmem.c    Sun May  7 22:25:46 1989
  97. X--- ../xlisp/xldmem.c    Wed Apr  5 16:18:25 1989
  98. X***************
  99. X*** 6,13 ****
  100. X  #include "xlisp.h"
  101. X  
  102. X  /* node flags */
  103. X! #define MARK    1
  104. X! #define LEFT    2
  105. X  
  106. X  /* macro to compute the size of a segment */
  107. X  #define segsize(n) (sizeof(SEGMENT)+((n)-1)*sizeof(struct node))
  108. X--- 6,13 ----
  109. X  #include "xlisp.h"
  110. X  
  111. X  /* node flags */
  112. X! #define MARK    0x20
  113. X! #define LEFT    0x40
  114. X  
  115. X  /* macro to compute the size of a segment */
  116. X  #define segsize(n) (sizeof(SEGMENT)+((n)-1)*sizeof(struct node))
  117. X***************
  118. X*** 21,37 ****
  119. X  SEGMENT *segs,*lastseg,*fixseg,*charseg;
  120. X  int anodes,nsegs,gccalls;
  121. X  long nnodes,nfree,total;
  122. X! LVAL fnodes;
  123. X  
  124. X  /* external procedures */
  125. X! extern char *malloc();
  126. X! extern char *calloc();
  127. X  
  128. X  /* forward declarations */
  129. X! FORWARD LVAL newnode();
  130. X  FORWARD unsigned char *stralloc();
  131. X  FORWARD SEGMENT *newsegment();
  132. X  
  133. X  /* cons - construct a new cons node */
  134. X  LVAL cons(x,y)
  135. X    LVAL x,y;
  136. X--- 21,50 ----
  137. X  SEGMENT *segs,*lastseg,*fixseg,*charseg;
  138. X  int anodes,nsegs,gccalls;
  139. X  long nnodes,nfree,total;
  140. X! LVAL fnodes = NIL;
  141. X  
  142. X  /* external procedures */
  143. X! extern char *xlmalloc();
  144. X! extern char *xlcalloc();
  145. X  
  146. X  /* forward declarations */
  147. X! FORWARD LVAL Newnode();
  148. X  FORWARD unsigned char *stralloc();
  149. X  FORWARD SEGMENT *newsegment();
  150. X  
  151. X+ LVAL _nnode;
  152. X+ FIXTYPE _tfixed;
  153. X+ int _tint;
  154. X+ 
  155. X+ #define    newnode(type) (((_nnode = fnodes) != NIL) ? \
  156. X+             ((fnodes = cdr(_nnode)), \
  157. X+              nfree--, \
  158. X+              (_nnode->n_type = type), \
  159. X+              rplacd(_nnode,NIL), \
  160. X+              _nnode) \
  161. X+             : (_nnode = Newnode(type)))
  162. X+ 
  163. X+ 
  164. X  /* cons - construct a new cons node */
  165. X  LVAL cons(x,y)
  166. X    LVAL x,y;
  167. X***************
  168. X*** 129,140 ****
  169. X  }
  170. X  
  171. X  /* cvfixnum - convert an integer to a fixnum node */
  172. X! LVAL cvfixnum(n)
  173. X    FIXTYPE n;
  174. X  {
  175. X      LVAL val;
  176. X-     if (n >= SFIXMIN && n <= SFIXMAX)
  177. X-     return (&fixseg->sg_nodes[(int)n-SFIXMIN]);
  178. X      val = newnode(FIXNUM);
  179. X      val->n_fixnum = n;
  180. X      return (val);
  181. X--- 142,151 ----
  182. X  }
  183. X  
  184. X  /* cvfixnum - convert an integer to a fixnum node */
  185. X! LVAL Cvfixnum(n)
  186. X    FIXTYPE n;
  187. X  {
  188. X      LVAL val;
  189. X      val = newnode(FIXNUM);
  190. X      val->n_fixnum = n;
  191. X      return (val);
  192. X***************
  193. X*** 151,157 ****
  194. X  }
  195. X  
  196. X  /* cvchar - convert an integer to a character node */
  197. X! LVAL cvchar(n)
  198. X    int n;
  199. X  {
  200. X      if (n >= CHARMIN && n <= CHARMAX)
  201. X--- 162,168 ----
  202. X  }
  203. X  
  204. X  /* cvchar - convert an integer to a character node */
  205. X! LVAL Cvchar(n)
  206. X    int n;
  207. X  {
  208. X      if (n >= CHARMIN && n <= CHARMAX)
  209. X***************
  210. X*** 180,185 ****
  211. X--- 191,225 ----
  212. X      return (val);
  213. X  }
  214. X  
  215. X+ #ifdef    WINDOWS
  216. X+ LVAL newwinobj(size)
  217. X+ int size;
  218. X+ {
  219. X+     LVAL val;
  220. X+     val = newnode(WINOBJ);
  221. X+     if (size > 0) {
  222. X+         xlprot1(val);
  223. X+         if ((val->n_winobj = xldcalloc(1,size)) == NULL) {
  224. X+             findmem();
  225. X+             if ((val->n_winobj = xldcalloc(1,size)) == NULL)
  226. X+                 xlfail("insufficient memory");
  227. X+             }
  228. X+         xlpop();
  229. X+         }
  230. X+     else val->n_winobj = NULL;
  231. X+     return(val);
  232. X+ }
  233. X+ 
  234. X+ LVAL cvwinobj(p)
  235. X+ char *p;
  236. X+     {
  237. X+     LVAL val;
  238. X+     val = newnode(WINOBJ);
  239. X+     val->n_winobj = p;
  240. X+     return(val);
  241. X+     }
  242. X+ #endif
  243. X+ 
  244. X  /* newclosure - allocate and initialize a new closure */
  245. X  LVAL newclosure(name,type,env,fenv)
  246. X    LVAL name,type,env,fenv;
  247. X***************
  248. X*** 204,212 ****
  249. X      vect = newnode(VECTOR);
  250. X      vect->n_vsize = 0;
  251. X      if (bsize = size * sizeof(LVAL)) {
  252. X!     if ((vect->n_vdata = (LVAL *)calloc(1,bsize)) == NULL) {
  253. X          findmem();
  254. X!         if ((vect->n_vdata = (LVAL *)calloc(1,bsize)) == NULL)
  255. X          xlfail("insufficient vector space");
  256. X      }
  257. X      vect->n_vsize = size;
  258. X--- 244,252 ----
  259. X      vect = newnode(VECTOR);
  260. X      vect->n_vsize = 0;
  261. X      if (bsize = size * sizeof(LVAL)) {
  262. X!     if ((vect->n_vdata = (LVAL *)xldcalloc(1,bsize)) == NULL) {
  263. X          findmem();
  264. X!         if ((vect->n_vdata = (LVAL *)xldcalloc(1,bsize)) == NULL)
  265. X          xlfail("insufficient vector space");
  266. X      }
  267. X      vect->n_vsize = size;
  268. X***************
  269. X*** 217,223 ****
  270. X  }
  271. X  
  272. X  /* newnode - allocate a new node */
  273. X! LOCAL LVAL newnode(type)
  274. X    int type;
  275. X  {
  276. X      LVAL nnode;
  277. X--- 257,263 ----
  278. X  }
  279. X  
  280. X  /* newnode - allocate a new node */
  281. X! LVAL Newnode(type)
  282. X    int type;
  283. X  {
  284. X      LVAL nnode;
  285. X***************
  286. X*** 248,256 ****
  287. X      unsigned char *sptr;
  288. X  
  289. X      /* allocate memory for the string copy */
  290. X!     if ((sptr = (unsigned char *)malloc(size)) == NULL) {
  291. X      gc();  
  292. X!     if ((sptr = (unsigned char *)malloc(size)) == NULL)
  293. X          xlfail("insufficient string space");
  294. X      }
  295. X      total += (long)size;
  296. X--- 288,296 ----
  297. X      unsigned char *sptr;
  298. X  
  299. X      /* allocate memory for the string copy */
  300. X!     if ((sptr = (unsigned char *)xldmalloc(size)) == NULL) {
  301. X      gc();  
  302. X!     if ((sptr = (unsigned char *)xldmalloc(size)) == NULL)
  303. X          xlfail("insufficient string space");
  304. X      }
  305. X      total += (long)size;
  306. X***************
  307. X*** 330,336 ****
  308. X    LVAL ptr;
  309. X  {
  310. X      register LVAL this,prev,tmp;
  311. X!     int type,i,n;
  312. X  
  313. X      /* initialize */
  314. X      prev = NIL;
  315. X--- 370,376 ----
  316. X    LVAL ptr;
  317. X  {
  318. X      register LVAL this,prev,tmp;
  319. X!     register int i,n;
  320. X  
  321. X      /* initialize */
  322. X      prev = NIL;
  323. X***************
  324. X*** 340,380 ****
  325. X      for (;;) {
  326. X  
  327. X      /* descend as far as we can */
  328. X!     while (!(this->n_flags & MARK))
  329. X  
  330. X          /* check cons and symbol nodes */
  331. X!         if ((type = ntype(this)) == CONS) {
  332. X!         if (tmp = car(this)) {
  333. X!             this->n_flags |= MARK|LEFT;
  334. X!             rplaca(this,prev);
  335. X!         }
  336. X!         else if (tmp = cdr(this)) {
  337. X!             this->n_flags |= MARK;
  338. X              rplacd(this,prev);
  339. X!         }
  340. X!         else {                /* both sides nil */
  341. X!             this->n_flags |= MARK;
  342. X              break;
  343. X!         }
  344. X!         prev = this;            /* step down the branch */
  345. X!         this = tmp;
  346. X!         }
  347. X! 
  348. X!         /* mark other node types */
  349. X          else {
  350. X!         this->n_flags |= MARK;
  351. X!         switch (type) {
  352. X!         case SYMBOL:
  353. X!         case OBJECT:
  354. X!         case VECTOR:
  355. X!         case CLOSURE:
  356. X!             for (i = 0, n = getsize(this); --n >= 0; ++i)
  357. X!             if (tmp = getelement(this,i))
  358. X!                 mark(tmp);
  359. X!             break;
  360. X!         }
  361. X!         break;
  362. X!         }
  363. X  
  364. X      /* backup to a point where we can continue descending */
  365. X      for (;;)
  366. X--- 380,409 ----
  367. X      for (;;) {
  368. X  
  369. X      /* descend as far as we can */
  370. X!     while (!(this->n_type & MARK))
  371. X  
  372. X          /* check cons and symbol nodes */
  373. X!         if ((i = (this->n_type |= MARK) & TYPEFIELD) == CONS) {
  374. X!           if (tmp = car(this)) {
  375. X!             this->n_type |= LEFT;
  376. X!             rplaca(this,prev);}
  377. X!           else if (tmp = cdr(this))
  378. X              rplacd(this,prev);
  379. X!           else                /* both sides nil */
  380. X              break;
  381. X!           prev = this;            /* step down the branch */
  382. X!           this = tmp;
  383. X!           }
  384. X          else {
  385. X!           if ((i & ARRAY) != 0)
  386. X!         for (i = 0, n = getsize(this); i < n;)
  387. X!           if (tmp = getelement(this,i++))
  388. X!             if ((tmp->n_type & (ARRAY|MARK)) == ARRAY ||
  389. X!              tmp->n_type == CONS)
  390. X!                 mark(tmp);
  391. X!             else tmp->n_type |= MARK;
  392. X!           break;
  393. X!           }
  394. X  
  395. X      /* backup to a point where we can continue descending */
  396. X      for (;;)
  397. X***************
  398. X*** 381,388 ****
  399. X  
  400. X          /* make sure there is a previous node */
  401. X          if (prev) {
  402. X!         if (prev->n_flags & LEFT) {    /* came from left side */
  403. X!             prev->n_flags &= ~LEFT;
  404. X              tmp = car(prev);
  405. X              rplaca(prev,this);
  406. X              if (this = cdr(prev)) {
  407. X--- 410,417 ----
  408. X  
  409. X          /* make sure there is a previous node */
  410. X          if (prev) {
  411. X!         if (prev->n_type & LEFT) {    /* came from left side */
  412. X!             prev->n_type &= ~LEFT;
  413. X              tmp = car(prev);
  414. X              rplaca(prev,this);
  415. X              if (this = cdr(prev)) {
  416. X***************
  417. X*** 399,406 ****
  418. X          }
  419. X  
  420. X          /* no previous node, must be done */
  421. X!         else
  422. X!         return;
  423. X      }
  424. X  }
  425. X  
  426. X--- 428,434 ----
  427. X          }
  428. X  
  429. X          /* no previous node, must be done */
  430. X!         else return;
  431. X      }
  432. X  }
  433. X  
  434. X***************
  435. X*** 407,434 ****
  436. X  /* sweep - sweep all unmarked nodes and add them to the free list */
  437. X  LOCAL sweep()
  438. X  {
  439. X!     SEGMENT *seg;
  440. X!     LVAL p;
  441. X!     int n;
  442. X  
  443. X-     /* empty the free list */
  444. X      fnodes = NIL;
  445. X!     nfree = 0L;
  446. X  
  447. X      /* add all unmarked nodes */
  448. X      for (seg = segs; seg; seg = seg->sg_next) {
  449. X!     if (seg == fixseg)     /* don't sweep the fixnum segment */
  450. X          continue;
  451. X-     else if (seg == charseg) /* don't sweep the character segment */
  452. X-         continue;
  453. X      p = &seg->sg_nodes[0];
  454. X!     for (n = seg->sg_size; --n >= 0; ++p)
  455. X!         if (!(p->n_flags & MARK)) {
  456. X          switch (ntype(p)) {
  457. X          case STRING:
  458. X              if (getstring(p) != NULL) {
  459. X                  total -= (long)getslength(p);
  460. X!                 free(getstring(p));
  461. X              }
  462. X              break;
  463. X          case STREAM:
  464. X--- 435,463 ----
  465. X  /* sweep - sweep all unmarked nodes and add them to the free list */
  466. X  LOCAL sweep()
  467. X  {
  468. X!     register SEGMENT *seg;
  469. X!     register LVAL p;
  470. X!     register int n;
  471. X  
  472. X      fnodes = NIL;
  473. X!     nfree = 0l;
  474. X  
  475. X      /* add all unmarked nodes */
  476. X      for (seg = segs; seg; seg = seg->sg_next) {
  477. X!     if (seg == fixseg || seg == charseg)
  478. X!          /* don't sweep the fixed segments */
  479. X          continue;
  480. X      p = &seg->sg_nodes[0];
  481. X!     for (n = seg->sg_size; --n >= 0;)
  482. X!         if (p->n_type & MARK)
  483. X!         (p++)->n_type &= ~MARK;
  484. X!         else {
  485. X          switch (ntype(p)) {
  486. X          case STRING:
  487. X              if (getstring(p) != NULL) {
  488. X                  total -= (long)getslength(p);
  489. X!            /* Using getstring here breaks VMEM (JonnyG) */
  490. X!                 xldfree(p->n_string);
  491. X              }
  492. X              break;
  493. X          case STREAM:
  494. X***************
  495. X*** 435,440 ****
  496. X--- 464,474 ----
  497. X              if (getfile(p))
  498. X                  osclose(getfile(p));
  499. X              break;
  500. X+ #ifdef    WINDOWS
  501. X+         case WINOBJ:
  502. X+             free_winobj(p);
  503. X+             break;
  504. X+ #endif
  505. X          case SYMBOL:
  506. X          case OBJECT:
  507. X          case VECTOR:
  508. X***************
  509. X*** 441,447 ****
  510. X          case CLOSURE:
  511. X              if (p->n_vsize) {
  512. X                  total -= (long) (p->n_vsize * sizeof(LVAL));
  513. X!                 free(p->n_vdata);
  514. X              }
  515. X              break;
  516. X          }
  517. X--- 475,481 ----
  518. X          case CLOSURE:
  519. X              if (p->n_vsize) {
  520. X                  total -= (long) (p->n_vsize * sizeof(LVAL));
  521. X!                 xldfree(p->n_vdata);
  522. X              }
  523. X              break;
  524. X          }
  525. X***************
  526. X*** 448,458 ****
  527. X          p->n_type = FREE;
  528. X          rplaca(p,NIL);
  529. X          rplacd(p,fnodes);
  530. X!         fnodes = p;
  531. X!         nfree += 1L;
  532. X          }
  533. X-         else
  534. X-         p->n_flags &= ~MARK;
  535. X      }
  536. X  }
  537. X  
  538. X--- 482,490 ----
  539. X          p->n_type = FREE;
  540. X          rplaca(p,NIL);
  541. X          rplacd(p,fnodes);
  542. X!         fnodes = p++;
  543. X!         nfree++;
  544. X          }
  545. X      }
  546. X  }
  547. X  
  548. X***************
  549. X*** 485,491 ****
  550. X      SEGMENT *newseg;
  551. X  
  552. X      /* allocate the new segment */
  553. X!     if ((newseg = (SEGMENT *)calloc(1,segsize(n))) == NULL)
  554. X      return (NULL);
  555. X  
  556. X      /* initialize the new segment */
  557. X--- 517,524 ----
  558. X      SEGMENT *newseg;
  559. X  
  560. X      /* allocate the new segment */
  561. X! 
  562. X!     if ((newseg = (SEGMENT *)xlcalloc(1,segsize(n))) == NULL)
  563. X      return (NULL);
  564. X  
  565. X      /* initialize the new segment */
  566. X***************
  567. X*** 666,677 ****
  568. X      s_gcflag = s_gchook = NIL;
  569. X  
  570. X      /* allocate the evaluation stack */
  571. X!     if ((xlstkbase = (LVAL **)malloc(EDEPTH * sizeof(LVAL *))) == NULL)
  572. X      xlfatal("insufficient memory");
  573. X      xlstack = xlstktop = xlstkbase + EDEPTH;
  574. X  
  575. X      /* allocate the argument stack */
  576. X!     if ((xlargstkbase = (LVAL *)malloc(ADEPTH * sizeof(LVAL))) == NULL)
  577. X      xlfatal("insufficient memory");
  578. X      xlargstktop = xlargstkbase + ADEPTH;
  579. X      xlfp = xlsp = xlargstkbase;
  580. X--- 699,710 ----
  581. X      s_gcflag = s_gchook = NIL;
  582. X  
  583. X      /* allocate the evaluation stack */
  584. X!     if ((xlstkbase = (LVAL **)xlmalloc(EDEPTH * sizeof(LVAL *))) == NULL)
  585. X      xlfatal("insufficient memory");
  586. X      xlstack = xlstktop = xlstkbase + EDEPTH;
  587. X  
  588. X      /* allocate the argument stack */
  589. X!     if ((xlargstkbase = (LVAL *)xlmalloc(ADEPTH * sizeof(LVAL))) == NULL)
  590. X      xlfatal("insufficient memory");
  591. X      xlargstktop = xlargstkbase + ADEPTH;
  592. X      xlfp = xlsp = xlargstkbase;
  593. Xdiff -c ../xlisp.org/xldmem.h ../xlisp/xldmem.h
  594. X*** ../xlisp.org/xldmem.h    Sun May  7 22:25:47 1989
  595. X--- ../xlisp/xldmem.h    Wed Apr  5 16:45:38 1989
  596. X***************
  597. X*** 13,21 ****
  598. X  #define CHARMAX        255
  599. X  #define CHARSIZE    256
  600. X  
  601. X- /* new node access macros */
  602. X- #define ntype(x)    ((x)->n_type)
  603. X- 
  604. X  /* cons access macros */
  605. X  #define car(x)        ((x)->n_car)
  606. X  #define cdr(x)        ((x)->n_cdr)
  607. X--- 13,18 ----
  608. X***************
  609. X*** 23,72 ****
  610. X  #define rplacd(x,y)    ((x)->n_cdr = (y))
  611. X  
  612. X  /* symbol access macros */
  613. X! #define getvalue(x)     ((x)->n_vdata[0])
  614. X! #define setvalue(x,v)     ((x)->n_vdata[0] = (v))
  615. X! #define getfunction(x)     ((x)->n_vdata[1])
  616. X! #define setfunction(x,v) ((x)->n_vdata[1] = (v))
  617. X! #define getplist(x)     ((x)->n_vdata[2])
  618. X! #define setplist(x,v)     ((x)->n_vdata[2] = (v))
  619. X! #define getpname(x)     ((x)->n_vdata[3])
  620. X! #define setpname(x,v)     ((x)->n_vdata[3] = (v))
  621. X  #define SYMSIZE        4
  622. X  
  623. X  /* closure access macros */
  624. X! #define getname(x)         ((x)->n_vdata[0])
  625. X! #define setname(x,v)       ((x)->n_vdata[0] = (v))
  626. X! #define gettype(x)        ((x)->n_vdata[1])
  627. X! #define settype(x,v)      ((x)->n_vdata[1] = (v))
  628. X! #define getargs(x)         ((x)->n_vdata[2])
  629. X! #define setargs(x,v)       ((x)->n_vdata[2] = (v))
  630. X! #define getoargs(x)        ((x)->n_vdata[3])
  631. X! #define setoargs(x,v)      ((x)->n_vdata[3] = (v))
  632. X! #define getrest(x)         ((x)->n_vdata[4])
  633. X! #define setrest(x,v)       ((x)->n_vdata[4] = (v))
  634. X! #define getkargs(x)        ((x)->n_vdata[5])
  635. X! #define setkargs(x,v)      ((x)->n_vdata[5] = (v))
  636. X! #define getaargs(x)        ((x)->n_vdata[6])
  637. X! #define setaargs(x,v)      ((x)->n_vdata[6] = (v))
  638. X! #define getbody(x)         ((x)->n_vdata[7])
  639. X! #define setbody(x,v)       ((x)->n_vdata[7] = (v))
  640. X! #define getenv(x)    ((x)->n_vdata[8])
  641. X! #define setenv(x,v)    ((x)->n_vdata[8] = (v))
  642. X! #define getfenv(x)    ((x)->n_vdata[9])
  643. X! #define setfenv(x,v)    ((x)->n_vdata[9] = (v))
  644. X! #define getlambda(x)    ((x)->n_vdata[10])
  645. X! #define setlambda(x,v)    ((x)->n_vdata[10] = (v))
  646. X  #define CLOSIZE        11
  647. X  
  648. X  /* vector access macros */
  649. X  #define getsize(x)    ((x)->n_vsize)
  650. X! #define getelement(x,i)    ((x)->n_vdata[i])
  651. X! #define setelement(x,i,v) ((x)->n_vdata[i] = (v))
  652. X  
  653. X  /* object access macros */
  654. X! #define getclass(x)    ((x)->n_vdata[0])
  655. X! #define getivar(x,i)    ((x)->n_vdata[i+1])
  656. X! #define setivar(x,i,v)    ((x)->n_vdata[i+1] = (v))
  657. X  
  658. X  /* subr/fsubr access macros */
  659. X  #define getsubr(x)    ((x)->n_subr)
  660. X--- 20,69 ----
  661. X  #define rplacd(x,y)    ((x)->n_cdr = (y))
  662. X  
  663. X  /* symbol access macros */
  664. X! #define getvalue(x)     (ACESSV(x,0))
  665. X! #define setvalue(x,v)     (ACESSV(x,0) = (v))
  666. X! #define getfunction(x)     (ACESSV(x,1))
  667. X! #define setfunction(x,v) (ACESSV(x,1) = (v))
  668. X! #define getplist(x)     (ACESSV(x,2))
  669. X! #define setplist(x,v)     (ACESSV(x,2) = (v))
  670. X! #define getpname(x)     (ACESSV(x,3))
  671. X! #define setpname(x,v)     (ACESSV(x,3) = (v))
  672. X  #define SYMSIZE        4
  673. X  
  674. X  /* closure access macros */
  675. X! #define getname(x)         (ACESSV(x,0))
  676. X! #define setname(x,v)       (ACESSV(x,0) = (v))
  677. X! #define gettype(x)        (ACESSV(x,1))
  678. X! #define settype(x,v)      (ACESSV(x,1) = (v))
  679. X! #define getargs(x)         (ACESSV(x,2))
  680. X! #define setargs(x,v)       (ACESSV(x,2) = (v))
  681. X! #define getoargs(x)        (ACESSV(x,3))
  682. X! #define setoargs(x,v)      (ACESSV(x,3) = (v))
  683. X! #define getrest(x)         (ACESSV(x,4))
  684. X! #define setrest(x,v)       (ACESSV(x,4) = (v))
  685. X! #define getkargs(x)        (ACESSV(x,5))
  686. X! #define setkargs(x,v)      (ACESSV(x,5) = (v))
  687. X! #define getaargs(x)        (ACESSV(x,6))
  688. X! #define setaargs(x,v)      (ACESSV(x,6) = (v))
  689. X! #define getbody(x)         (ACESSV(x,7))
  690. X! #define setbody(x,v)       (ACESSV(x,7) = (v))
  691. X! #define getenv(x)    (ACESSV(x,8))
  692. X! #define setenv(x,v)    (ACESSV(x,8) = (v))
  693. X! #define getfenv(x)    (ACESSV(x,9))
  694. X! #define setfenv(x,v)    (ACESSV(x,9) = (v))
  695. X! #define getlambda(x)    (ACESSV(x,10))
  696. X! #define setlambda(x,v)    (ACESSV(x,10) = (v))
  697. X  #define CLOSIZE        11
  698. X  
  699. X  /* vector access macros */
  700. X  #define getsize(x)    ((x)->n_vsize)
  701. X! #define getelement(x,i)    (ACESSV(x,i))
  702. X! #define setelement(x,i,v) (ACESSV(x,i) = (v))
  703. X  
  704. X  /* object access macros */
  705. X! #define getclass(x)    (ACESSV(x,0))
  706. X! #define getivar(x,i)    (ACESSV(x,i+1))
  707. X! #define setivar(x,i,v)    (ACESSV(x,i+1) = (v))
  708. X  
  709. X  /* subr/fsubr access macros */
  710. X  #define getsubr(x)    ((x)->n_subr)
  711. X***************
  712. X*** 78,84 ****
  713. X  #define getchcode(x)    ((x)->n_chcode)
  714. X  
  715. X  /* string access macros */
  716. X! #define getstring(x)    ((x)->n_string)
  717. X  #define getslength(x)    ((x)->n_strlen)
  718. X  
  719. X  /* file stream access macros */
  720. X--- 75,81 ----
  721. X  #define getchcode(x)    ((x)->n_chcode)
  722. X  
  723. X  /* string access macros */
  724. X! #define getstring(x)    (ACESSS((x)->n_string))
  725. X  #define getslength(x)    ((x)->n_strlen)
  726. X  
  727. X  /* file stream access macros */
  728. X***************
  729. X*** 93,114 ****
  730. X  #define gettail(x)    ((x)->n_cdr)
  731. X  #define settail(x,v)    ((x)->n_cdr = (v))
  732. X  
  733. X  /* node types */
  734. X  #define FREE    0
  735. X  #define SUBR    1
  736. X  #define FSUBR    2
  737. X  #define CONS    3
  738. X! #define SYMBOL    4
  739. X! #define FIXNUM    5
  740. X! #define FLONUM    6
  741. X! #define STRING    7
  742. X! #define OBJECT    8
  743. X! #define STREAM    9
  744. X! #define VECTOR    10
  745. X! #define CLOSURE    11
  746. X! #define CHAR    12
  747. X! #define USTREAM    13
  748. X  
  749. X  /* subr/fsubr node */
  750. X  #define n_subr        n_info.n_xsubr.xs_subr
  751. X  #define n_offset    n_info.n_xsubr.xs_offset
  752. X--- 90,121 ----
  753. X  #define gettail(x)    ((x)->n_cdr)
  754. X  #define settail(x,v)    ((x)->n_cdr = (v))
  755. X  
  756. X+ #define    getwinobj(x)    (ACESSS((x)->n_winobj))
  757. X+ #define    setwinobj(x,v)    ((x)->n_winobj = (v))
  758. X+ 
  759. X  /* node types */
  760. X  #define FREE    0
  761. X+ #define SYMBOL    17
  762. X+ #define OBJECT    18
  763. X+ #define VECTOR    19
  764. X+ #define CLOSURE    20
  765. X  #define SUBR    1
  766. X  #define FSUBR    2
  767. X  #define CONS    3
  768. X! #define FIXNUM    4
  769. X! #define FLONUM    5
  770. X! #define STRING    6
  771. X! #define STREAM    7
  772. X! #define CHAR    8
  773. X! #define USTREAM    9
  774. X! #define    WINOBJ    10
  775. X  
  776. X+ #define    ARRAY    16
  777. X+ #define TYPEFIELD 0x1f
  778. X+ 
  779. X+ /* new node access macros */
  780. X+ #define ntype(x)    ((x)->n_type & TYPEFIELD)
  781. X+ 
  782. X  /* subr/fsubr node */
  783. X  #define n_subr        n_info.n_xsubr.xs_subr
  784. X  #define n_offset    n_info.n_xsubr.xs_offset
  785. X***************
  786. X*** 137,146 ****
  787. X  #define n_vsize        n_info.n_xvector.xv_size
  788. X  #define n_vdata        n_info.n_xvector.xv_data
  789. X  
  790. X  /* node structure */
  791. X  typedef struct node {
  792. X      char n_type;        /* type of node */
  793. X-     char n_flags;        /* flag bits */
  794. X      union ninfo {         /* value */
  795. X      struct xsubr {        /* subr/fsubr node */
  796. X          struct node *(*xs_subr)();    /* function pointer */
  797. X--- 144,155 ----
  798. X  #define n_vsize        n_info.n_xvector.xv_size
  799. X  #define n_vdata        n_info.n_xvector.xv_data
  800. X  
  801. X+ /* window/font node */
  802. X+ #define    n_winobj    n_info.n_xwinobj.xw_ptr
  803. X+ 
  804. X  /* node structure */
  805. X  typedef struct node {
  806. X      char n_type;        /* type of node */
  807. X      union ninfo {         /* value */
  808. X      struct xsubr {        /* subr/fsubr node */
  809. X          struct node *(*xs_subr)();    /* function pointer */
  810. X***************
  811. X*** 171,176 ****
  812. X--- 180,188 ----
  813. X          int xv_size;        /* vector size */
  814. X          struct node **xv_data;    /* vector data */
  815. X      } n_xvector;
  816. X+     struct xwinobj {    /* window/font object */
  817. X+         char *xw_ptr;        /* Generic structure pointer */
  818. X+     } n_xwinobj;
  819. X      } n_info;
  820. X  } *LVAL;
  821. X  
  822. X***************
  823. X*** 187,195 ****
  824. X  extern LVAL cvstring();           /* convert a string */
  825. X  extern LVAL cvfile();        /* convert a FILE * to a file */
  826. X  extern LVAL cvsubr();        /* convert a function to a subr/fsubr */
  827. X! extern LVAL cvfixnum();           /* convert a fixnum */
  828. X  extern LVAL cvflonum();           /* convert a flonum */
  829. X! extern LVAL cvchar();        /* convert a character */
  830. X  
  831. X  extern LVAL newstring();    /* create a new string */
  832. X  extern LVAL newvector();    /* create a new vector */
  833. X--- 199,207 ----
  834. X  extern LVAL cvstring();           /* convert a string */
  835. X  extern LVAL cvfile();        /* convert a FILE * to a file */
  836. X  extern LVAL cvsubr();        /* convert a function to a subr/fsubr */
  837. X! extern LVAL Cvfixnum();           /* convert a fixnum */
  838. X  extern LVAL cvflonum();           /* convert a flonum */
  839. X! extern LVAL Cvchar();        /* convert a character */
  840. X  
  841. X  extern LVAL newstring();    /* create a new string */
  842. X  extern LVAL newvector();    /* create a new vector */
  843. X***************
  844. X*** 196,198 ****
  845. X--- 208,249 ----
  846. X  extern LVAL newobject();    /* create a new object */
  847. X  extern LVAL newclosure();    /* create a new closure */
  848. X  extern LVAL newustream();    /* create a new unnamed stream */
  849. X+ 
  850. X+ 
  851. X+ /* Speed ups, reduce function calls for fixed characters and numbers       */
  852. X+ /* Speed is exeptionaly noticed on machines with large a instruction cache */
  853. X+ /* No size effects here (JonnyG) */
  854. X+ 
  855. X+ extern SEGMENT *fixseg,*charseg;
  856. X+ extern FIXTYPE _tfixed;
  857. X+ extern int _tint;
  858. X+ 
  859. X+ #define cvfixnum(n) ((_tfixed = n), \
  860. X+         ((_tfixed > SFIXMIN && _tfixed < SFIXMAX) ? \
  861. X+         &fixseg->sg_nodes[(int)_tfixed-SFIXMIN] : \
  862. X+         Cvfixnum(_tfixed)))
  863. X+ 
  864. X+ #define cvchar(c) ((_tint = c), \
  865. X+         ((_tint >= CHARMIN && _tint <= CHARMIN) ? \
  866. X+             &charseg->sg_nodes[_tint-CHARMIN] : \
  867. X+         Cvchar(_tint)))
  868. X+ 
  869. X+ extern    char *xldmalloc();
  870. X+ extern    char *xldcalloc();
  871. X+ 
  872. X+ #ifdef    VMEM
  873. X+ 
  874. X+ extern char *vload();
  875. X+ 
  876. X+ extern    unsigned char *vaccess();
  877. X+ 
  878. X+ #define    ACESSV(x,i)    (((LVAL *)vaccess((x)->n_vdata))[i])
  879. X+ #define    ACESSS(x)    (vaccess(x))
  880. X+ 
  881. X+ #else
  882. X+ 
  883. X+ #define    xlfcalloc    xlcalloc
  884. X+ #define ACESSV(x,i)    (x)->n_vdata[i]
  885. X+ #define    ACESSS(x)    x
  886. X+ 
  887. X+ #endif
  888. Xdiff -c ../xlisp.org/xlfio.c ../xlisp/xlfio.c
  889. X*** ../xlisp.org/xlfio.c    Sun May  7 22:25:52 1989
  890. X--- ../xlisp/xlfio.c    Wed Apr  5 16:18:27 1989
  891. X***************
  892. X*** 349,355 ****
  893. X  
  894. X      /* copy the substring into the stream */
  895. X      for (i = start; i < end; ++i)
  896. X!     xlputc(val,str[i]);
  897. X  
  898. X      /* restore the stack */
  899. X      xlpop();
  900. X--- 349,355 ----
  901. X  
  902. X      /* copy the substring into the stream */
  903. X      for (i = start; i < end; ++i)
  904. X!     xlputc(val,getstring(string) + i);
  905. X  
  906. X      /* restore the stack */
  907. X      xlpop();
  908. X***************
  909. X*** 450,456 ****
  910. X  LOCAL LVAL getstroutput(stream)
  911. X    LVAL stream;
  912. X  {
  913. X!     unsigned char *str;
  914. X      LVAL next,val;
  915. X      int len,ch;
  916. X  
  917. X--- 450,456 ----
  918. X  LOCAL LVAL getstroutput(stream)
  919. X    LVAL stream;
  920. X  {
  921. X!     int i;
  922. X      LVAL next,val;
  923. X      int len,ch;
  924. X  
  925. X***************
  926. X*** 462,471 ****
  927. X      val = newstring(len + 1);
  928. X      
  929. X      /* copy the characters into the new string */
  930. X!     str = getstring(val);
  931. X      while ((ch = xlgetc(stream)) != EOF)
  932. X!     *str++ = ch;
  933. X!     *str = '\0';
  934. X  
  935. X      /* return the string */
  936. X      return (val);
  937. X--- 462,471 ----
  938. X      val = newstring(len + 1);
  939. X      
  940. X      /* copy the characters into the new string */
  941. X!     i = 0;
  942. X      while ((ch = xlgetc(stream)) != EOF)
  943. X!     getstring(val)[i++] = ch;
  944. X!     getstring(val)[i] = '\0';
  945. X  
  946. X      /* return the string */
  947. X      return (val);
  948. X
  949. X
  950. XFrom sce!mitel!uunet!lll-winken!ames!haven!umd5!jonnyg Tue May 23 15:37:32 EDT 1989
  951. XArticle: 92 of comp.lang.lisp.x
  952. XPath: cognos!sce!mitel!uunet!lll-winken!ames!haven!umd5!jonnyg
  953. XFrom: jonnyg@umd5.umd.edu (Jon Greenblatt)
  954. XNewsgroups: comp.lang.lisp.x
  955. XSubject: Xlisp 2.0 speedups (Part 2 of 3)
  956. XMessage-ID: <4913@umd5.umd.edu>
  957. XDate: 18 May 89 16:59:37 GMT
  958. XReply-To: jonnyg@umd5.umd.edu (Jon Greenblatt)
  959. XOrganization: University of Maryland, College Park
  960. XLines: 913
  961. X
  962. Xdiff -c ../xlisp.org/xlftab.c ../xlisp/xlftab.c
  963. X*** ../xlisp.org/xlftab.c    Sun May  7 22:25:54 1989
  964. X--- ../xlisp/xlftab.c    Wed Apr  5 16:18:28 1989
  965. X***************
  966. X*** 11,17 ****
  967. X      rmhash(),rmquote(),rmdquote(),rmbquote(),rmcomma(),
  968. X      clnew(),clisnew(),clanswer(),
  969. X      obisnew(),obclass(),obshow(),
  970. X!     rmlpar(),rmrpar(),rmsemi(),
  971. X      xeval(),xapply(),xfuncall(),xquote(),xfunction(),xbquote(),
  972. X      xlambda(),xset(),xsetq(),xsetf(),xdefun(),xdefmacro(),
  973. X      xgensym(),xmakesymbol(),xintern(),
  974. X--- 11,17 ----
  975. X      rmhash(),rmquote(),rmdquote(),rmbquote(),rmcomma(),
  976. X      clnew(),clisnew(),clanswer(),
  977. X      obisnew(),obclass(),obshow(),
  978. X!     rmlpar(),rmrpar(),rmlbrace(),rmrbrace(),rmsemi(),
  979. X      xeval(),xapply(),xfuncall(),xquote(),xfunction(),xbquote(),
  980. X      xlambda(),xset(),xsetq(),xsetf(),xdefun(),xdefmacro(),
  981. X      xgensym(),xmakesymbol(),xintern(),
  982. X***************
  983. X*** 70,76 ****
  984. X      xcharp(),xcharint(),xintchar(),
  985. X      xmkstrinput(),xmkstroutput(),xgetstroutput(),xgetlstoutput(),
  986. X      xgetlambda(),xmacroexpand(),x1macroexpand(),
  987. X!     xtrace(),xuntrace();
  988. X  
  989. X  /* functions specific to xldmem.c */
  990. X  LVAL xgc(),xexpand(),xalloc(),xmem();
  991. X--- 70,76 ----
  992. X      xcharp(),xcharint(),xintchar(),
  993. X      xmkstrinput(),xmkstroutput(),xgetstroutput(),xgetlstoutput(),
  994. X      xgetlambda(),xmacroexpand(),x1macroexpand(),
  995. X!     xtrace(),xuntrace(),xcopyarray();
  996. X  
  997. X  /* functions specific to xldmem.c */
  998. X  LVAL xgc(),xexpand(),xalloc(),xmem();
  999. X***************
  1000. X*** 90,96 ****
  1001. X  
  1002. X  /* the function table */
  1003. X  FUNDEF funtab[] = {
  1004. X- 
  1005. X      /* read macro functions */
  1006. X  {    NULL,                S, rmhash        }, /*   0 */
  1007. X  {    NULL,                S, rmquote        }, /*   1 */
  1008. X--- 90,95 ----
  1009. X***************
  1010. X*** 100,107 ****
  1011. X  {    NULL,                S, rmlpar        }, /*   5 */
  1012. X  {    NULL,                S, rmrpar        }, /*   6 */
  1013. X  {    NULL,                S, rmsemi        }, /*   7 */
  1014. X! {    NULL,                S, xnotimp        }, /*   8 */
  1015. X! {    NULL,                S, xnotimp        }, /*   9 */
  1016. X  
  1017. X      /* methods */
  1018. X  {    NULL,                S, clnew        }, /*  10 */
  1019. X--- 99,106 ----
  1020. X  {    NULL,                S, rmlpar        }, /*   5 */
  1021. X  {    NULL,                S, rmrpar        }, /*   6 */
  1022. X  {    NULL,                S, rmsemi        }, /*   7 */
  1023. X! {    NULL,                S, rmlbrace        }, /*   8 */
  1024. X! {    NULL,                S, rmrbrace        }, /*   9 */
  1025. X  
  1026. X      /* methods */
  1027. X  {    NULL,                S, clnew        }, /*  10 */
  1028. X***************
  1029. X*** 426,432 ****
  1030. X  {    "SORT",                S, xsort        }, /* 284 */
  1031. X  
  1032. X      /* extra table entries */
  1033. X! {    NULL,                S, xnotimp        }, /* 285 */
  1034. X  {    NULL,                S, xnotimp        }, /* 286 */
  1035. X  {    NULL,                S, xnotimp        }, /* 287 */
  1036. X  {    NULL,                S, xnotimp        }, /* 288 */
  1037. X--- 425,431 ----
  1038. X  {    "SORT",                S, xsort        }, /* 284 */
  1039. X  
  1040. X      /* extra table entries */
  1041. X! {    "COPY-ARRAY",            S, xcopyarray        }, /* 285 */
  1042. X  {    NULL,                S, xnotimp        }, /* 286 */
  1043. X  {    NULL,                S, xnotimp        }, /* 287 */
  1044. X  {    NULL,                S, xnotimp        }, /* 288 */
  1045. X***************
  1046. X*** 447,453 ****
  1047. X  
  1048. X  {0,0,0} /* end of table marker */
  1049. X  
  1050. X! };            
  1051. X  
  1052. X  /* xnotimp - function table entries that are currently not implemented */
  1053. X  LOCAL LVAL xnotimp()
  1054. X--- 446,452 ----
  1055. X  
  1056. X  {0,0,0} /* end of table marker */
  1057. X  
  1058. X! };
  1059. X  
  1060. X  /* xnotimp - function table entries that are currently not implemented */
  1061. X  LOCAL LVAL xnotimp()
  1062. Xdiff -c ../xlisp.org/xlglob.c ../xlisp/xlglob.c
  1063. X*** ../xlisp.org/xlglob.c    Sun May  7 22:25:55 1989
  1064. X--- ../xlisp/xlglob.c    Wed Apr  5 16:18:28 1989
  1065. X***************
  1066. X*** 22,27 ****
  1067. X--- 22,28 ----
  1068. X  LVAL s_1plus=NIL,s_2plus=NIL,s_3plus=NIL;
  1069. X  LVAL s_1star=NIL,s_2star=NIL,s_3star=NIL;
  1070. X  LVAL s_minus=NIL,s_printcase=NIL;
  1071. X+ LVAL s_send=NIL,s_sendsuper=NIL;
  1072. X  
  1073. X  /* keywords */
  1074. X  LVAL k_test=NIL,k_tnot=NIL;
  1075. Xdiff -c ../xlisp.org/xlimage.c ../xlisp/xlimage.c
  1076. X*** ../xlisp.org/xlimage.c    Sun May  7 22:25:57 1989
  1077. X--- ../xlisp/xlimage.c    Wed Apr  5 16:18:28 1989
  1078. X***************
  1079. X*** 22,28 ****
  1080. X  /* external procedures */
  1081. X  extern SEGMENT *newsegment();
  1082. X  extern FILE *osbopen();
  1083. X! extern char *malloc();
  1084. X  
  1085. X  /* forward declarations */
  1086. X  OFFTYPE readptr();
  1087. X--- 22,28 ----
  1088. X  /* external procedures */
  1089. X  extern SEGMENT *newsegment();
  1090. X  extern FILE *osbopen();
  1091. X! extern char *xlmalloc();
  1092. X  
  1093. X  /* forward declarations */
  1094. X  OFFTYPE readptr();
  1095. X***************
  1096. X*** 170,176 ****
  1097. X      case USTREAM:
  1098. X          p = cviptr(off);
  1099. X          p->n_type = type;
  1100. X-         p->n_flags = 0;
  1101. X          rplaca(p,cviptr(readptr()));
  1102. X          rplacd(p,cviptr(readptr()));
  1103. X          off += 2;
  1104. X--- 170,175 ----
  1105. X***************
  1106. X*** 192,198 ****
  1107. X          case VECTOR:
  1108. X          case CLOSURE:
  1109. X          max = getsize(p);
  1110. X!         if ((p->n_vdata = (LVAL *)malloc(max * sizeof(LVAL))) == NULL)
  1111. X              xlfatal("insufficient memory - vector");
  1112. X          total += (long)(max * sizeof(LVAL));
  1113. X          for (i = 0; i < max; ++i)
  1114. X--- 191,197 ----
  1115. X          case VECTOR:
  1116. X          case CLOSURE:
  1117. X          max = getsize(p);
  1118. X!         if ((p->n_vdata = (LVAL *)xlmalloc(max * sizeof(LVAL))) == NULL)
  1119. X              xlfatal("insufficient memory - vector");
  1120. X          total += (long)(max * sizeof(LVAL));
  1121. X          for (i = 0; i < max; ++i)
  1122. X***************
  1123. X*** 200,206 ****
  1124. X          break;
  1125. X          case STRING:
  1126. X          max = getslength(p);
  1127. X!         if ((p->n_string = (unsigned char *)malloc(max)) == NULL)
  1128. X              xlfatal("insufficient memory - string");
  1129. X          total += (long)max;
  1130. X          for (cp = getstring(p); --max >= 0; )
  1131. X--- 199,205 ----
  1132. X          break;
  1133. X          case STRING:
  1134. X          max = getslength(p);
  1135. X!         if ((p->n_string = (unsigned char *)xlmalloc(max)) == NULL)
  1136. X              xlfatal("insufficient memory - string");
  1137. X          total += (long)max;
  1138. X          for (cp = getstring(p); --max >= 0; )
  1139. X***************
  1140. X*** 247,257 ****
  1141. X          case VECTOR:
  1142. X          case CLOSURE:
  1143. X          if (p->n_vsize)
  1144. X!             free(p->n_vdata);
  1145. X          break;
  1146. X          case STRING:
  1147. X          if (getslength(p))
  1148. X!             free(getstring(p));
  1149. X          break;
  1150. X          case STREAM:
  1151. X          if ((fp = getfile(p)) && (fp != stdin && fp != stdout))
  1152. X--- 246,256 ----
  1153. X          case VECTOR:
  1154. X          case CLOSURE:
  1155. X          if (p->n_vsize)
  1156. X!             xlfree(p->n_vdata);
  1157. X          break;
  1158. X          case STRING:
  1159. X          if (getslength(p))
  1160. X!             xlfree(getstring(p));
  1161. X          break;
  1162. X          case STREAM:
  1163. X          if ((fp = getfile(p)) && (fp != stdin && fp != stdout))
  1164. X***************
  1165. X*** 259,265 ****
  1166. X          break;
  1167. X          }
  1168. X      next = seg->sg_next;
  1169. X!     free(seg);
  1170. X      }
  1171. X  }
  1172. X  
  1173. X--- 258,264 ----
  1174. X          break;
  1175. X          }
  1176. X      next = seg->sg_next;
  1177. X!     xlfree(seg);
  1178. X      }
  1179. X  }
  1180. X  
  1181. X***************
  1182. X*** 302,308 ****
  1183. X      char *p = (char *)&node->n_info;
  1184. X      int n = sizeof(union ninfo);
  1185. X      node->n_type = type;
  1186. X-     node->n_flags = 0;
  1187. X      while (--n >= 0)
  1188. X      *p++ = osbgetc(fp);
  1189. X  }
  1190. X--- 301,306 ----
  1191. Xdiff -c ../xlisp.org/xlinit.c ../xlisp/xlinit.c
  1192. X*** ../xlisp.org/xlinit.c    Sun May  7 22:25:59 1989
  1193. X--- ../xlisp/xlinit.c    Wed Apr  5 16:18:29 1989
  1194. X***************
  1195. X*** 27,32 ****
  1196. X--- 27,33 ----
  1197. X  extern LVAL a_fixnum,a_flonum,a_string,a_stream,a_object;
  1198. X  extern LVAL a_vector,a_closure,a_char,a_ustream;
  1199. X  extern LVAL s_gcflag,s_gchook;
  1200. X+ extern LVAL s_send,s_sendsuper;
  1201. X  extern FUNDEF funtab[];
  1202. X  
  1203. X  /* xlinit - xlisp initialization routine */
  1204. X***************
  1205. X*** 106,111 ****
  1206. X--- 107,114 ----
  1207. X      s_eql    = xlenter("EQL");
  1208. X      s_ifmt    = xlenter("*INTEGER-FORMAT*");
  1209. X      s_ffmt    = xlenter("*FLOAT-FORMAT*");
  1210. X+     s_send    = xlenter("SEND");
  1211. X+     s_sendsuper = xlenter("SEND-SUPER");
  1212. X  
  1213. X      /* symbols set by the read-eval-print loop */
  1214. X      s_1plus    = xlenter("+");
  1215. Xdiff -c ../xlisp.org/xlisp.c ../xlisp/xlisp.c
  1216. X*** ../xlisp.org/xlisp.c    Sun May  7 22:26:02 1989
  1217. X--- ../xlisp/xlisp.c    Thu Apr  6 10:06:46 1989
  1218. X***************
  1219. X*** 6,12 ****
  1220. X  #include "xlisp.h"
  1221. X  
  1222. X  /* define the banner line string */
  1223. X! #define BANNER    "XLISP version 2.0, Copyright (c) 1988, by David Betz"
  1224. X  
  1225. X  /* global variables */
  1226. X  jmp_buf top_level;
  1227. X--- 6,12 ----
  1228. X  #include "xlisp.h"
  1229. X  
  1230. X  /* define the banner line string */
  1231. X! #define BANNER    "XLISP version 2.0w, Copyright (c) 1988, by David Betz"
  1232. X  
  1233. X  /* global variables */
  1234. X  jmp_buf top_level;
  1235. X***************
  1236. X*** 52,60 ****
  1237. X          }
  1238. X  #endif
  1239. X  
  1240. X      /* initialize and print the banner line */
  1241. X      osinit(BANNER);
  1242. X- 
  1243. X      /* setup initialization error handler */
  1244. X      xlbegin(&cntxt,CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL,(LVAL)1);
  1245. X      if (setjmp(cntxt.c_jmpbuf))
  1246. X--- 52,63 ----
  1247. X          }
  1248. X  #endif
  1249. X  
  1250. X+ #ifdef    X11
  1251. X+     parse_args(&argc,argv);
  1252. X+ #endif
  1253. X+ 
  1254. X      /* initialize and print the banner line */
  1255. X      osinit(BANNER);
  1256. X      /* setup initialization error handler */
  1257. X      xlbegin(&cntxt,CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL,(LVAL)1);
  1258. X      if (setjmp(cntxt.c_jmpbuf))
  1259. X***************
  1260. X*** 61,67 ****
  1261. X      xlfatal("fatal initialization error");
  1262. X      if (setjmp(top_level))
  1263. X      xlfatal("RESTORE not allowed during initialization");
  1264. X- 
  1265. X      /* initialize xlisp */
  1266. X      xlinit();
  1267. X      xlend(&cntxt);
  1268. X--- 64,69 ----
  1269. Xdiff -c ../xlisp.org/xlisp.h ../xlisp/xlisp.h
  1270. X*** ../xlisp.org/xlisp.h    Sun May  7 22:26:12 1989
  1271. X--- ../xlisp/xlisp.h    Wed Apr  5 16:23:51 1989
  1272. X***************
  1273. X*** 4,10 ****
  1274. X      Permission is granted for unrestricted non-commercial use    */
  1275. X  
  1276. X  /* system specific definitions */
  1277. X! /* #define UNIX */
  1278. X  
  1279. X  #include <stdio.h>
  1280. X  #include <ctype.h>
  1281. X--- 4,11 ----
  1282. X      Permission is granted for unrestricted non-commercial use    */
  1283. X  
  1284. X  /* system specific definitions */
  1285. X! #define X11
  1286. X! /* #define    ADEBUG */
  1287. X  
  1288. X  #include <stdio.h>
  1289. X  #include <ctype.h>
  1290. X***************
  1291. X*** 24,29 ****
  1292. X--- 25,35 ----
  1293. X  /* OFFTYPE    number the size of an address (int) */
  1294. X  
  1295. X  /* for the BSD 4.3 system.  Might work for AT&T garbage */
  1296. X+ #ifdef    X11
  1297. X+ #define    UNIX
  1298. X+ #define WINDOWS
  1299. X+ #endif
  1300. X+ 
  1301. X  #ifdef UNIX
  1302. X  #define NNODES        2000
  1303. X  #define SAVERESTORE
  1304. X***************
  1305. X*** 82,87 ****
  1306. X--- 88,105 ----
  1307. X  #define OFFTYPE        long
  1308. X  #endif
  1309. X  
  1310. X+ #ifdef MSW
  1311. X+ #define NNODES        1000
  1312. X+ #define AFMT        "%lx"
  1313. X+ #define OFFTYPE        long
  1314. X+ #define    WINDOWS
  1315. X+ #define    VMEM
  1316. X+ #define    MSC
  1317. X+ #define    xlmalloc    WMalloc
  1318. X+ #define    xlcalloc    WCalloc
  1319. X+ #define    xlfree        WFree
  1320. X+ #endif
  1321. X+ 
  1322. X  /* for the Mark Williams C compiler - Atari ST */
  1323. X  #ifdef MWC
  1324. X  #define AFMT        "%lx"
  1325. X***************
  1326. X*** 148,153 ****
  1327. X--- 166,176 ----
  1328. X  #ifndef UCHAR
  1329. X  #define UCHAR        unsigned char
  1330. X  #endif
  1331. X+ #ifndef    xlmalloc
  1332. X+ #define    xlmalloc    malloc
  1333. X+ #define    xlcalloc    calloc
  1334. X+ #define    xlfree        free
  1335. X+ #endif
  1336. X  
  1337. X  /* useful definitions */
  1338. X  #define TRUE    1
  1339. X***************
  1340. X*** 160,166 ****
  1341. X  #include "xldmem.h"
  1342. X  
  1343. X  /* program limits */
  1344. X! #define STRMAX        100        /* maximum length of a string constant */
  1345. X  #define HSIZE        199        /* symbol hash table size */
  1346. X  #define SAMPLE        100        /* control character sample rate */
  1347. X  
  1348. X--- 183,189 ----
  1349. X  #include "xldmem.h"
  1350. X  
  1351. X  /* program limits */
  1352. X! #define STRMAX        512        /* maximum length of a string constant */
  1353. X  #define HSIZE        199        /* symbol hash table size */
  1354. X  #define SAMPLE        100        /* control character sample rate */
  1355. X  
  1356. X***************
  1357. X*** 173,178 ****
  1358. X--- 196,203 ----
  1359. X  #define FT_RMLPAR    5
  1360. X  #define FT_RMRPAR    6
  1361. X  #define FT_RMSEMI    7
  1362. X+ #define    FT_RMLBRACE    8
  1363. X+ #define    FT_RMRBRACE    9
  1364. X  #define FT_CLNEW    10
  1365. X  #define FT_CLISNEW    11
  1366. X  #define FT_CLANSWER    12
  1367. X***************
  1368. X*** 179,191 ****
  1369. X  #define FT_OBISNEW    13
  1370. X  #define FT_OBCLASS    14
  1371. X  #define FT_OBSHOW    15
  1372. X!     
  1373. X  /* macro to push a value onto the argument stack */
  1374. X  #define pusharg(x)    {if (xlsp >= xlargstktop) xlargstkoverflow();\
  1375. X!              *xlsp++ = (x);}
  1376. X  
  1377. X  /* macros to protect pointers */
  1378. X! #define xlstkcheck(n)    {if (xlstack - (n) < xlstkbase) xlstkoverflow();}
  1379. X  #define xlsave(n)    {*--xlstack = &n; n = NIL;}
  1380. X  #define xlprotect(n)    {*--xlstack = &n;}
  1381. X  
  1382. X--- 204,216 ----
  1383. X  #define FT_OBISNEW    13
  1384. X  #define FT_OBCLASS    14
  1385. X  #define FT_OBSHOW    15
  1386. X! 
  1387. X  /* macro to push a value onto the argument stack */
  1388. X  #define pusharg(x)    {if (xlsp >= xlargstktop) xlargstkoverflow();\
  1389. X!              *(xlsp++) = (x);}
  1390. X  
  1391. X  /* macros to protect pointers */
  1392. X! #define xlstkcheck(n)    {if ((xlstack - (n)) < xlstkbase) xlstkoverflow();}
  1393. X  #define xlsave(n)    {*--xlstack = &n; n = NIL;}
  1394. X  #define xlprotect(n)    {*--xlstack = &n;}
  1395. X  
  1396. X***************
  1397. X*** 230,235 ****
  1398. X--- 255,261 ----
  1399. X  #define ustreamp(x)    ((x) && ntype(x) == USTREAM)
  1400. X  #define boundp(x)    (getvalue(x) != s_unbound)
  1401. X  #define fboundp(x)    (getfunction(x) != s_unbound)
  1402. X+ #define    winobjp(x)    ((x) && ntype(x) == WINOBJ)
  1403. X  
  1404. X  /* shorthand functions */
  1405. X  #define consa(x)    cons(x,NIL)
  1406. X***************
  1407. X*** 323,326 ****
  1408. X  /* error reporting functions (don't *really* return at all) */
  1409. X  extern LVAL xltoofew();        /* report "too few arguments" error */
  1410. X  extern LVAL xlbadtype();    /* report "bad argument type" error */
  1411. X- 
  1412. X--- 349,351 ----
  1413. Xdiff -c ../xlisp.org/xlobj.c ../xlisp/xlobj.c
  1414. X*** ../xlisp.org/xlobj.c    Sun May  7 22:26:20 1989
  1415. X--- ../xlisp/xlobj.c    Wed Apr  5 16:18:40 1989
  1416. X***************
  1417. X*** 41,47 ****
  1418. X  /* xsendsuper - send a message to the superclass of an object */
  1419. X  LVAL xsendsuper()
  1420. X  {
  1421. X!     LVAL env,p;
  1422. X      for (env = xlenv; env; env = cdr(env))
  1423. X      if ((p = car(env)) && objectp(car(p)))
  1424. X          return (sendmsg(car(p),
  1425. X--- 41,47 ----
  1426. X  /* xsendsuper - send a message to the superclass of an object */
  1427. X  LVAL xsendsuper()
  1428. X  {
  1429. X!     register LVAL env,p;
  1430. X      for (env = xlenv; env; env = cdr(env))
  1431. X      if ((p = car(env)) && objectp(car(p)))
  1432. X          return (sendmsg(car(p),
  1433. X***************
  1434. X*** 97,104 ****
  1435. X  int xlobgetvalue(pair,sym,pval)
  1436. X    LVAL pair,sym,*pval;
  1437. X  {
  1438. X!     LVAL cls,names;
  1439. X!     int ivtotal,n;
  1440. X  
  1441. X      /* find the instance or class variable */
  1442. X      for (cls = cdr(pair); objectp(cls); cls = getivar(cls,SUPERCLASS)) {
  1443. X--- 97,104 ----
  1444. X  int xlobgetvalue(pair,sym,pval)
  1445. X    LVAL pair,sym,*pval;
  1446. X  {
  1447. X!     register LVAL cls,names;
  1448. X!     register int ivtotal,n;
  1449. X  
  1450. X      /* find the instance or class variable */
  1451. X      for (cls = cdr(pair); objectp(cls); cls = getivar(cls,SUPERCLASS)) {
  1452. X***************
  1453. X*** 133,140 ****
  1454. X  int xlobsetvalue(pair,sym,val)
  1455. X    LVAL pair,sym,val;
  1456. X  {
  1457. X!     LVAL cls,names;
  1458. X!     int ivtotal,n;
  1459. X  
  1460. X      /* find the instance or class variable */
  1461. X      for (cls = cdr(pair); objectp(cls); cls = getivar(cls,SUPERCLASS)) {
  1462. X--- 133,140 ----
  1463. X  int xlobsetvalue(pair,sym,val)
  1464. X    LVAL pair,sym,val;
  1465. X  {
  1466. X!     register LVAL cls,names;
  1467. X!     register int ivtotal,n;
  1468. X  
  1469. X      /* find the instance or class variable */
  1470. X      for (cls = cdr(pair); objectp(cls); cls = getivar(cls,SUPERCLASS)) {
  1471. X***************
  1472. X*** 309,315 ****
  1473. X  LOCAL LVAL sendmsg(obj,cls,sym)
  1474. X    LVAL obj,cls,sym;
  1475. X  {
  1476. X!     LVAL msg,msgcls,method,val,p;
  1477. X  
  1478. X      /* look for the message in the class or superclasses */
  1479. X      for (msgcls = cls; msgcls; ) {
  1480. X--- 309,316 ----
  1481. X  LOCAL LVAL sendmsg(obj,cls,sym)
  1482. X    LVAL obj,cls,sym;
  1483. X  {
  1484. X!     LVAL method,val;
  1485. X!     register LVAL msg,msgcls,p;
  1486. X  
  1487. X      /* look for the message in the class or superclasses */
  1488. X      for (msgcls = cls; msgcls; ) {
  1489. X***************
  1490. X*** 316,322 ****
  1491. X  
  1492. X      /* lookup the message in this class */
  1493. X      for (p = getivar(msgcls,MESSAGES); p; p = cdr(p))
  1494. X!         if ((msg = car(p)) && car(msg) == sym)
  1495. X          goto send_message;
  1496. X  
  1497. X      /* look in class's superclass */
  1498. X--- 317,323 ----
  1499. X  
  1500. X      /* lookup the message in this class */
  1501. X      for (p = getivar(msgcls,MESSAGES); p; p = cdr(p))
  1502. X!         if ((msg = car(p)) ? car(msg) == sym : 0)
  1503. X          goto send_message;
  1504. X  
  1505. X      /* look in class's superclass */
  1506. X***************
  1507. X*** 363,369 ****
  1508. X  LOCAL LVAL evmethod(obj,msgcls,method)
  1509. X    LVAL obj,msgcls,method;
  1510. X  {
  1511. X!     LVAL oldenv,oldfenv,cptr,name,val;
  1512. X      CONTEXT cntxt;
  1513. X  
  1514. X      /* protect some pointers */
  1515. X--- 364,370 ----
  1516. X  LOCAL LVAL evmethod(obj,msgcls,method)
  1517. X    LVAL obj,msgcls,method;
  1518. X  {
  1519. X!     LVAL oldenv,oldfenv,name,cptr,val;
  1520. X      CONTEXT cntxt;
  1521. X  
  1522. X      /* protect some pointers */
  1523. X***************
  1524. X*** 420,428 ****
  1525. X  
  1526. X  /* listlength - find the length of a list */
  1527. X  LOCAL int listlength(list)
  1528. X!   LVAL list;
  1529. X  {
  1530. X!     int len;
  1531. X      for (len = 0; consp(list); len++)
  1532. X      list = cdr(list);
  1533. X      return (len);
  1534. X--- 421,429 ----
  1535. X  
  1536. X  /* listlength - find the length of a list */
  1537. X  LOCAL int listlength(list)
  1538. X! register LVAL list;
  1539. X  {
  1540. X!     register int len;
  1541. X      for (len = 0; consp(list); len++)
  1542. X      list = cdr(list);
  1543. X      return (len);
  1544. X***************
  1545. X*** 470,473 ****
  1546. X      xladdmsg(object,":CLASS",FT_OBCLASS);
  1547. X      xladdmsg(object,":SHOW",FT_OBSHOW);
  1548. X  }
  1549. X- 
  1550. X--- 471,473 ----
  1551. Xdiff -c ../xlisp.org/xlprin.c ../xlisp/xlprin.c
  1552. X*** ../xlisp.org/xlprin.c    Sun May  7 22:26:23 1989
  1553. X--- ../xlisp/xlprin.c    Fri May  5 13:35:51 1989
  1554. X***************
  1555. X*** 33,38 ****
  1556. X--- 33,41 ----
  1557. X      case FSUBR:
  1558. X          putsubr(fptr,"FSubr",vptr);
  1559. X          break;
  1560. X+     case WINOBJ:
  1561. X+         putsymbol(fptr,"<Windows object>",flag);
  1562. X+         break;
  1563. X      case CONS:
  1564. X          xlputc(fptr,'(');
  1565. X          for (nptr = vptr; nptr != NIL; nptr = next) {
  1566. Xdiff -c ../xlisp.org/xlread.c ../xlisp/xlread.c
  1567. X*** ../xlisp.org/xlread.c    Sun May  7 22:26:26 1989
  1568. X--- ../xlisp/xlread.c    Wed Apr  5 16:18:41 1989
  1569. X***************
  1570. X*** 15,20 ****
  1571. X--- 15,21 ----
  1572. X  extern LVAL s_quote,s_function,s_bquote,s_comma,s_comat;
  1573. X  extern LVAL s_rtable,k_wspace,k_const,k_nmacro,k_tmacro;
  1574. X  extern LVAL k_sescape,k_mescape;
  1575. X+ extern LVAL s_send, s_sendsuper;
  1576. X  extern char buf[];
  1577. X  
  1578. X  /* external routines */
  1579. X***************
  1580. X*** 29,35 ****
  1581. X  /* forward declarations */
  1582. X  FORWARD LVAL callmacro();
  1583. X  FORWARD LVAL psymbol(),punintern();
  1584. X! FORWARD LVAL pnumber(),pquote(),plist(),pvector();
  1585. X  FORWARD LVAL tentry();
  1586. X  
  1587. X  /* xlload - load a file of xlisp expressions */
  1588. X--- 30,36 ----
  1589. X  /* forward declarations */
  1590. X  FORWARD LVAL callmacro();
  1591. X  FORWARD LVAL psymbol(),punintern();
  1592. X! FORWARD LVAL pnumber(),pquote(),plist(),pmessage(),pvector();
  1593. X  FORWARD LVAL tentry();
  1594. X  
  1595. X  /* xlload - load a file of xlisp expressions */
  1596. X***************
  1597. X*** 366,371 ****
  1598. X--- 367,386 ----
  1599. X      return (consa(plist(fptr)));
  1600. X  }
  1601. X  
  1602. X+ /* rmlbrace - read macro for '{' */
  1603. X+ LVAL rmlbrace()
  1604. X+ {
  1605. X+     LVAL fptr,mch;
  1606. X+ 
  1607. X+     /* get the file and macro character */
  1608. X+     fptr = xlgetfile();
  1609. X+     mch = xlgachar();
  1610. X+     xllastarg();
  1611. X+ 
  1612. X+     /* make the return value */
  1613. X+     return (consa(pmessage(fptr)));
  1614. X+ }
  1615. X+ 
  1616. X  /* rmrpar - read macro for ')' */
  1617. X  LVAL rmrpar()
  1618. X  {
  1619. X***************
  1620. X*** 372,377 ****
  1621. X--- 387,398 ----
  1622. X      xlfail("misplaced right paren");
  1623. X  }
  1624. X  
  1625. X+ /* rmbrace - read macro for '}' */
  1626. X+ LVAL rmrbrace()
  1627. X+ {
  1628. X+     xlfail("misplaced right brace");
  1629. X+ }
  1630. X+ 
  1631. X  /* rmsemi - read macro for ';' */
  1632. X  LVAL rmsemi()
  1633. X  {
  1634. X***************
  1635. X*** 485,490 ****
  1636. X--- 506,555 ----
  1637. X      return (val);
  1638. X  }
  1639. X  
  1640. X+ /* plist - parse a message */
  1641. X+ LOCAL LVAL pmessage(fptr)
  1642. X+   LVAL fptr;
  1643. X+ {
  1644. X+     LVAL val,expr,lastnptr,nptr;
  1645. X+     LVAL mess = s_send;
  1646. X+ 
  1647. X+     /* protect some pointers */
  1648. X+     xlstkcheck(2);
  1649. X+     xlsave(val);
  1650. X+     xlsave(expr);
  1651. X+ 
  1652. X+     if (nextch(fptr) == '+') { /* Look for super class message */
  1653. X+     mess = s_sendsuper;
  1654. X+     xlgetc(fptr);
  1655. X+     }
  1656. X+ 
  1657. X+     /* keep appending nodes until a closing paren is found */
  1658. X+     for (lastnptr = NIL; nextch(fptr) != '}'; )
  1659. X+ 
  1660. X+     /* get the next expression */
  1661. X+     if (readone(fptr,&expr) == EOF)
  1662. X+         badeof(fptr);
  1663. X+     else {
  1664. X+         nptr = consa(expr);
  1665. X+         if (lastnptr == NIL)
  1666. X+         val = nptr;
  1667. X+         else
  1668. X+         rplacd(lastnptr,nptr);
  1669. X+         lastnptr = nptr;
  1670. X+         }
  1671. X+ 
  1672. X+     /* skip the closing bracket */
  1673. X+     xlgetc(fptr);
  1674. X+ 
  1675. X+     val = cons(mess,val);
  1676. X+ 
  1677. X+     /* restore the stack */
  1678. X+     xlpopn(2);
  1679. X+ 
  1680. X+     /* return successfully */
  1681. X+     return (val);
  1682. X+ }
  1683. X+ 
  1684. X  /* pvector - parse a vector */
  1685. X  LOCAL LVAL pvector(fptr)
  1686. X    LVAL fptr;
  1687. X***************
  1688. X*** 807,811 ****
  1689. X--- 872,878 ----
  1690. X      defmacro('(', k_tmacro,FT_RMLPAR);
  1691. X      defmacro(')', k_tmacro,FT_RMRPAR);
  1692. X      defmacro(';', k_tmacro,FT_RMSEMI);
  1693. X+     defmacro('{', k_tmacro,FT_RMLBRACE);
  1694. X+     defmacro('}', k_tmacro,FT_RMRBRACE);
  1695. X  }
  1696. X  
  1697. Xdiff -c ../xlisp.org/xlsym.c ../xlisp/xlsym.c
  1698. X*** ../xlisp.org/xlsym.c    Sun May  7 22:26:32 1989
  1699. X--- ../xlisp/xlsym.c    Wed Apr  5 16:18:43 1989
  1700. X***************
  1701. X*** 4,10 ****
  1702. X      Permission is granted for unrestricted non-commercial use    */
  1703. X  
  1704. X  #include "xlisp.h"
  1705. X! 
  1706. X  /* external variables */
  1707. X  extern LVAL obarray,s_unbound;
  1708. X  extern LVAL xlenv,xlfenv,xldenv;
  1709. X--- 4,11 ----
  1710. X      Permission is granted for unrestricted non-commercial use    */
  1711. X  
  1712. X  #include "xlisp.h"
  1713. X! #undef HSIZE
  1714. X! #define HSIZE 399
  1715. X  /* external variables */
  1716. X  extern LVAL obarray,s_unbound;
  1717. X  extern LVAL xlenv,xlfenv,xldenv;
  1718. X***************
  1719. X*** 16,22 ****
  1720. X  LVAL xlenter(name)
  1721. X    char *name;
  1722. X  {
  1723. X!     LVAL sym,array;
  1724. X      int i;
  1725. X  
  1726. X      /* check for nil */
  1727. X--- 17,24 ----
  1728. X  LVAL xlenter(name)
  1729. X    char *name;
  1730. X  {
  1731. X!     register LVAL sym,array;
  1732. X!     LVAL sym2;
  1733. X      int i;
  1734. X  
  1735. X      /* check for nil */
  1736. X***************
  1737. X*** 31,44 ****
  1738. X          return (car(sym));
  1739. X  
  1740. X      /* make a new symbol node and link it into the list */
  1741. X!     xlsave1(sym);
  1742. X!     sym = consd(getelement(array,i));
  1743. X!     rplaca(sym,xlmakesym(name));
  1744. X!     setelement(array,i,sym);
  1745. X      xlpop();
  1746. X- 
  1747. X      /* return the new symbol */
  1748. X!     return (car(sym));
  1749. X  }
  1750. X  
  1751. X  /* xlmakesym - make a new symbol node */
  1752. X--- 33,45 ----
  1753. X          return (car(sym));
  1754. X  
  1755. X      /* make a new symbol node and link it into the list */
  1756. X!     xlsave1(sym2);
  1757. X!     sym2 = consd(getelement(array,i));
  1758. X!     rplaca(sym2,xlmakesym(name));
  1759. X!     setelement(array,i,sym2);
  1760. X      xlpop();
  1761. X      /* return the new symbol */
  1762. X!     return (car(sym2));
  1763. X  }
  1764. X  
  1765. X  /* xlmakesym - make a new symbol node */
  1766. X***************
  1767. X*** 68,74 ****
  1768. X  
  1769. X  /* xlxgetvalue - get the value of a symbol */
  1770. X  LVAL xlxgetvalue(sym)
  1771. X!   LVAL sym;
  1772. X  {
  1773. X      register LVAL fp,ep;
  1774. X      LVAL val;
  1775. X--- 69,75 ----
  1776. X  
  1777. X  /* xlxgetvalue - get the value of a symbol */
  1778. X  LVAL xlxgetvalue(sym)
  1779. X! register LVAL sym;
  1780. X  {
  1781. X      register LVAL fp,ep;
  1782. X      LVAL val;
  1783. X***************
  1784. X*** 95,101 ****
  1785. X  
  1786. X  /* xlsetvalue - set the value of a symbol */
  1787. X  xlsetvalue(sym,val)
  1788. X!   LVAL sym,val;
  1789. X  {
  1790. X      register LVAL fp,ep;
  1791. X  
  1792. X--- 96,103 ----
  1793. X  
  1794. X  /* xlsetvalue - set the value of a symbol */
  1795. X  xlsetvalue(sym,val)
  1796. X!   register LVAL sym;
  1797. X!   LVAL val;
  1798. X  {
  1799. X      register LVAL fp,ep;
  1800. X  
  1801. X***************
  1802. X*** 137,143 ****
  1803. X  
  1804. X  /* xlxgetfunction - get the functional value of a symbol */
  1805. X  LVAL xlxgetfunction(sym)
  1806. X!   LVAL sym;
  1807. X  {
  1808. X      register LVAL fp,ep;
  1809. X  
  1810. X--- 139,145 ----
  1811. X  
  1812. X  /* xlxgetfunction - get the functional value of a symbol */
  1813. X  LVAL xlxgetfunction(sym)
  1814. X! register  LVAL sym;
  1815. X  {
  1816. X      register LVAL fp,ep;
  1817. X  
  1818. X***************
  1819. X*** 192,198 ****
  1820. X  xlremprop(sym,prp)
  1821. X    LVAL sym,prp;
  1822. X  {
  1823. X!     LVAL last,p;
  1824. X      last = NIL;
  1825. X      for (p = getplist(sym); consp(p) && consp(cdr(p)); p = cdr(last)) {
  1826. X      if (car(p) == prp)
  1827. X--- 194,200 ----
  1828. X  xlremprop(sym,prp)
  1829. X    LVAL sym,prp;
  1830. X  {
  1831. X!     register LVAL last,p;
  1832. X      last = NIL;
  1833. X      for (p = getplist(sym); consp(p) && consp(cdr(p)); p = cdr(last)) {
  1834. X      if (car(p) == prp)
  1835. X***************
  1836. X*** 208,214 ****
  1837. X  LOCAL LVAL findprop(sym,prp)
  1838. X    LVAL sym,prp;
  1839. X  {
  1840. X!     LVAL p;
  1841. X      for (p = getplist(sym); consp(p) && consp(cdr(p)); p = cdr(cdr(p)))
  1842. X      if (car(p) == prp)
  1843. X          return (cdr(p));
  1844. X--- 210,216 ----
  1845. X  LOCAL LVAL findprop(sym,prp)
  1846. X    LVAL sym,prp;
  1847. X  {
  1848. X!     register LVAL p;
  1849. X      for (p = getplist(sym); consp(p) && consp(cdr(p)); p = cdr(cdr(p)))
  1850. X      if (car(p) == prp)
  1851. X          return (cdr(p));
  1852. X***************
  1853. X*** 217,226 ****
  1854. X  
  1855. X  /* hash - hash a symbol name string */
  1856. X  int hash(str,len)
  1857. X!   char *str;
  1858. X  {
  1859. X!     int i;
  1860. X!     for (i = 0; *str; )
  1861. X      i = (i << 2) ^ *str++;
  1862. X      i %= len;
  1863. X      return (i < 0 ? -i : i);
  1864. X--- 219,228 ----
  1865. X  
  1866. X  /* hash - hash a symbol name string */
  1867. X  int hash(str,len)
  1868. X! register char *str;
  1869. X  {
  1870. X!     register int i = 0;
  1871. X!     while (*str)
  1872. X      i = (i << 2) ^ *str++;
  1873. X      i %= len;
  1874. X      return (i < 0 ? -i : i);
  1875. X
  1876. X
  1877. X
  1878. SHAR_EOF
  1879. if test 47351 -ne "`wc -c 'xlspeed.dif'`"
  1880. then
  1881.     echo shar: error transmitting "'xlspeed.dif'" '(should have been 47351 characters)'
  1882. fi
  1883. #    End of shell archive
  1884. exit 0
  1885. -- 
  1886. Gary Murphy                   uunet!mitel!sce!cognos!garym
  1887.                               (garym%cognos.uucp@uunet.uu.net)
  1888. (613) 738-1338 x5537          Cognos Inc. P.O. Box 9707 Ottawa K1G 3N3
  1889. "There are many things which do not concern the process" - Joan of Arc
  1890.  
  1891.